package metu.tespit.entity.course;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;


/**
 
 * @created 13 Nis 2012
 */
@Entity
@Table(name="announcement")
public class Announcement implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8212385228022016535L;

	@Id @GeneratedValue
	private Long id;

    @NotNull
	private String title;
	
	@Length(max=1000)
	private String detail;
	
	@Temporal(TemporalType.DATE)
	private Date creationDate;

	@ManyToOne
	private Course course;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public Date getCreationDate() {
		return creationDate;
	}

}
